# coding=utf-8
"""
Author: Mr.夏末
@Function: 元组：线性数据结构
不允许改变的列表,一般用于函数的返回，或者不变的配置
"""
# 定义
tuple01 = ()
print(type(tuple01))
# 关键字tuple

# 一个元素的元组括号代表优先级
tuple02 = (2)
print(type(tuple02))

tuple03 = (2,)
print(type(tuple03))

tuple04 = (1,2,3,4,5,6)
print(type(tuple04))

# 查
print(tuple04[2])

# 增删改不能用，只能查
# 可以拼接和截取（得到一个新元祖）
print(tuple04[:1])
print(tuple04+(4,5,6))
print(tuple04[::-1])
